# Tellitests - c2008, Telligent Systems, Inc.
# See LICENSE.txt for license details.
#
# Tellitests Functions File
#
# Description:
# This file contains various functions to be used globally throughout
# the tests.
#

def randomChar( len )
  chars = ("a".."z").to_a + ("A".."Z").to_a
  newpass = ""
  1.upto(len) { |i| newpass << chars[rand(chars.size-1)] }
  return newpass
end



def startClicker( button , waitTime = 3)
  w = WinClicker.new
  longName = ie.dir.gsub("/" , "\\" )
  shortName = w.getShortFileName(longName)
  c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} "
  puts "Starting #{c}"
  w.winsystem(c)
  w=nil
end

def build_windows_path(part) 
  build_path(part).gsub(/\//, "\\")
end

def build_path(part) 
  $myDir = Dir.getwd
  "#{$myDir}/#{part}"
end

def verifyHomeText
    assert(ie.contains_text(/Community Server/))
end

